package com.sunducation.wts.lifecycle

import android.app.Application
import android.util.Log
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent

class MyFragmentLifeCycleObserver() : LifecycleObserver{
    //不能使用activityde的context，如果需要，使用application的context;
    private val TAG:String = "MyFLCO";

    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    private fun testCreate(){
        Log.i(TAG,"testCreate");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_START)
    private fun testStart(){
        Log.i(TAG,"testStart");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    private fun testResume(){
        Log.i(TAG,"testResume");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    private fun testPause(){
        Log.i(TAG,"testPause");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    private fun testStop(){
        Log.i(TAG,"testStop");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    private fun testDestroy(){
        Log.i(TAG,"testDestroy");
    }

}